package com.hxd.otc.module.order.adapter;

import android.app.Activity;
import android.text.TextUtils;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hxd.otc.R;
import com.hxd.otc.module.order.bean.AdOrderDetailBean;
import com.hxd.otc.module.order.bean.OrderDetailBean;
import com.hxd.otc.utils.GlideUtils;

/**
 * 包  名 :  com.hxd.otc.module.order.adapter
 * 类  名 :  OrderDetailAlipayAdapter
 * 作  者 :  zjl
 * 时  间 :  2018/6/15 17:42
 * 描  述 :  ${TODO} 订单详情页---支付宝信息
 */
public class AdOrderDetailAlipayAdapter extends BaseQuickAdapter<AdOrderDetailBean.AlipayInfoPoData, BaseViewHolder> {

    Activity context;

    public AdOrderDetailAlipayAdapter(Activity context) {
        super(R.layout.adapter_ad_order_detail_alipay, null);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, AdOrderDetailBean.AlipayInfoPoData item) {
        helper.setText(R.id.tv_pay_name, item.alipayName);
        helper.setGone(R.id.tv_remark, !TextUtils.isEmpty(item.remark));
        helper.setText(R.id.tv_remark, item.remark);
        helper.setText(R.id.tv_account, item.no);
        GlideUtils.loadCenterCrop(context, item.alipayAddress, (ImageView) helper.getView(R.id.iv_alipay), R.mipmap.order_qrcode_icon);
    }
}
